package org.df.ulab.bot.engine.commands;

import org.df.ulab.bot.api.command.CommandPattern;
import org.df.ulab.bot.api.message.Message;
import org.df.ulab.bot.util.command.AbstractCommand;
import org.df.ulab.bot.util.core.EngineSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Daniel Filgueiras
 * @since 19/06/2011
 */
@CommandPattern(patterns={"(?i)^//(Abort|Bye)$"})
public class Abort extends AbstractCommand {

	private static final Logger logger = LoggerFactory.getLogger(Abort.class);
	
	@Override
	public boolean proccess(Message message) {
		logger.debug("Session was shutdown by message: {}", message);
		EngineSession.sessionShutdown();
		return true;
	}

}
